import request from '@/utils/request'

export function chart_json_params(plot_name,method) {
  return request({
    url: '/chartIframe',
    method: 'GET',
    params:{plot_type:plot_name,method:method}
  })
}

export function chart_json_html(my_data,my_set_options,plot_name,method) {
    return request({
      url: '/chartIframe',
      method: 'POST',
      data:{data:my_data,set_options:my_set_options,plot_type:plot_name,method:method}
    })
}

export function chart_form_ui(chart_name) {
  return request({
    url: '/generateFormUi/'+chart_name,
    method: 'GET'
  })
}

export function chart_form_ui_post(chart_name, file_name) {
  return request({
    url: '/generateFormUi/'+chart_name,
    method: 'POST',
    data:{file_name:file_name}
  })
}

export function chart_form_view(my_set_options,plot_name,file_name) {
  return request({
    url: '/generateFormChart/',
    method: 'POST',
    data:{set_options:my_set_options,
          plot_type:plot_name,
          file_name:file_name}
  })
}


export function select_my_data() {
  return request({
    url: '/select_my_data',
    method: 'GET'
  })
}
